package com.atguigu.gulimall.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;




/**
 * 1、@EnableScheduling 开启定时任务
 * 2、@Scheduled 开启一个定时任务
 */

@Component
@Slf4j
//@EnableScheduling
//@EnableAsync
public class HelloSchedule {

    /**
     * 1、spring中只允许6位组成，不允许第七位的年
     * 2、
     */
    //@Async
    //@Scheduled(cron = "* * * ? * *")
    public void hello() throws InterruptedException {
        log.info("hello");
        Thread.sleep(3000);
    }
}
